import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.2
import QtQuick.Layouts 1.0
import QtQuick.Layouts 1.1

import "../widgets" as Widgets

ApplicationWindow {
    visible: true
    minimumWidth: 350
    minimumHeight: 150
    maximumWidth: 350
    maximumHeight: 150

    title: "关于"

    RowLayout {
        anchors.fill: parent
        anchors.topMargin: 10
        anchors.rightMargin: 20
        anchors.bottomMargin: 10
        anchors.leftMargin: 20
        spacing: 20

        Widgets.CircleImage {
            id: logo
            width: 100
            height: 100
            imageSource: "qrc:/images/avatar_default.png"
        }

        ColumnLayout{
            Text {
                id: appName
                anchors.horizontalCenter: parent.horizontalCenter
                Layout.fillWidth: true
                text: "健康云通讯"
                font.bold: true
                font.pointSize: 20
            }

            Text {
                id: version
                anchors.top: appName.bottom
                Layout.fillWidth: true
                text: "版本：1.0.0001"
            }

            Text {
                id: copyright
                anchors.top: version.bottom
                Layout.fillWidth: true
                text: "版权所有©2002~2017"
            }

            Text {
                id: website
                anchors.top: copyright.bottom
                Layout.fillWidth: true
                text: "<html><style type='text/css'></style>医护网: <a href='https://www.yihu.com'>https://www.yihu.com</a></html>"

                onLinkActivated: {
                    Qt.openUrlExternally(link)
                }

                MouseArea {
                    z: 10
                    hoverEnabled: true
                    onEntered: {
                        cursorShape = Qt.OpenHandCursor;
                    }

                    onExited: {
                        cursorShape = Qt.ArrowCursor;
                    }
                }
            }
        }
    }
}
